package com.situ.mall.base.mapper;

import com.situ.mall.base.entity.OrderInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.situ.mall.base.vo.MemberOrderInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author darling
 * @since 2023-04-11
 */
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {

    @Select("SELECT COUNT(1) FROM t_order_info")
    Long statistics();

    List<MemberOrderInfo> doList(String keyword);

    @Select("SELECT * FROM t_order_info")
    List<OrderInfo> orderList();

    @Update("UPDATE t_order_info SET `status` = #{status} WHERE id = #{id}")
    void updateStatusById(@Param("id") Integer id, @Param("status") int status);


}
